<?php
	require_once("conexion/conexion.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<link href="Estilos/global.css" rel="stylesheet" type="text/css" />
<link href="Estilos/local.css" rel="stylesheet" type="text/css" />
<link href="Estilos/CssTabla3.css" rel="stylesheet" type="text/css" />

<script src="include_js/jquery.js" type="text/javascript"></script>
<script>
function Direccionar2()
{
	//alert('dir');
		$.ajax({
				type: 'POST',
				url: 'Tabla_Area.php',
				data: $('#analisis').serialize(),
				success: function(data) {
					$('#tabla').html(data);
				}
			})
}

function Eliminar(valor)
{
	id = document.getElementById("tbBodega").rows[valor].cells[0].innerText;
	
		$.ajax({
					type: 'POST',
					url: 'Editar/Eliminar_Area.php',
					data: {id:id},
					success: function(data) {
						$('#eliminar').html(data);
						Direccionar2();
					}
				})
}
</script>
</head>

<body>
<form name="analisis" id="analisis" method="post">
<?php
		$con = new Conexion();
		$con2 = $con->conexionBD("fpproduccion");
		$sql="select ACod,ANombre from area where AEstado=0 order by ANombre";
		$res= mysql_query($sql) or die ($con->error_mysql("Error en la consulta".mysql_error()));
		$con->cerrarBD();
?>
<div style="height:5px"></div>
<div class='option2'><label style="font:Verdana, Arial, Helvetica, sans-serif; color:#0066CC; font-weight:bold;">Areas Laborales Ingresadas.</label><div style="display:inline; margin-left:505px;"><img src="imagen/cerrar.png" width="16" height="16" onclick="CerrarDatos();" style="cursor: pointer; border: 1px solid #990000;" alt="Cerrar" /></div></div>
   <div class="cabecera">
   <table class="fija" border="0" cellpadding="0" cellspacing="0" id="tbBodega">
      <thead class="fija">
      	<tr class="fija">
      	    <th width="5%" class="fija">id</th>
      	    <th width="90%" class="fija">nombre area laboral</th>
			<th width="5%" class="fija">acci&Oacute;n</th>
      	</tr>
      </thead>
      <tbody class="fija">
         <tr class="fija"><td class="fija" colspan="3">&nbsp;</td></tr>
		<?php
	$aux = 2;
	while($reg = mysql_fetch_array($res))
	{
		if(($aux % 2)==0)
		{
			echo "<tr class='filaImpar' id='".$aux."'>";
			echo "<td style='text-align:center;'>".$reg['ACod']."</td>";
			echo "<td style='text-align:lefth;padding-left:250px;'>".$reg['ANombre']."</td>";
			echo "<td style='text-align:center'><img src='imagen/delete_icon.gif' width='16' height='16' alt='Eliminar' style='cursor: pointer;' onclick='Eliminar($aux);'/></td>";
			echo "</tr>";
		}
		else
		{
			echo "<tr class='filaPar' id='".$aux."'>";
			echo "<td style='text-align:center;'>".$reg['ACod']."</td>";
			echo "<td style='text-align:lefth;padding-left:250px;'>".$reg['ANombre']."</td>";
			echo "<td style='text-align:center'><img src='imagen/delete_icon.gif' width='16' height='16' alt='Eliminar' style='cursor: pointer;' onclick='Eliminar($aux);'/></td>";
			echo "</tr>";
		}
		$aux++;
	}
	?>
      </tbody>
   </table>       
</div>
<div id="eliminar"></div>
</form>
</body>
</html>
